//
//  LRJRecTravelDetailTextCell.m
//  BreadTravel
//
//  Created by 李润嘉 on 15/12/25.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "LRJRecTravelDetailTextCell.h"

@implementation LRJRecTravelDetailTextCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return self;
}
- (void)createSubView
{
    self.textlabel = [[UILabel alloc] init];
    self.backgroundColor = [UIColor whiteColor];
    self.textlabel.numberOfLines = 0;
    [self.contentView addSubview:self.textlabel];
    
    self.clockImage = [[UIImageView alloc]init];
    self.clockImage.image = [UIImage imageNamed:@"clock_gray_big@2x.png"];
    [self.contentView addSubview:self.clockImage];
    
    
    self.loca_time = [[UILabel alloc]init];
    self.loca_time.font = [UIFont systemFontOfSize:13];
    self.loca_time.alpha = 0.6;
    [self.contentView addSubview:self.loca_time];
}
- (void)setWayModel:(LRJTravelDetailWaypointsModel *)wayModel
{
    [self.textlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(@10);
        make.right.mas_equalTo(@-10);
        make.top.mas_equalTo(@10);
        
    }];
    [self.clockImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.textlabel.mas_bottom).offset(10);
        make.left.mas_equalTo(@10);
        
    }];
    [self.loca_time mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.textlabel.mas_bottom).offset(8);
        make.left.equalTo(self.clockImage.mas_right);
        make.height.mas_equalTo(@20);
        make.width.mas_equalTo(@200);
    }];
    
    self.textlabel.text = wayModel.text;
    self.loca_time.text  =wayModel.local_time;

}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
